<div ng-controller="CustomsorderCtrl" ng-init="listAction()">
    <ul class="sui-breadcrumb">
        <li>{{'外部订单'| translate}}</li>
        <li class="active">
            {{"List"|translate}}
            <a class="sui-btn btn-primary" href="#/customsorder/configlist">配置</a>
        </li>
        <span class="sui-form sui-form pull-right">
            <input type="text" placeholder="{{'Orderid'|translate}}" ng-model="order_id">
            <input placeholder="{{'start time'|translate}}" datetimepicker ng-model="start_created">
            <input placeholder="{{'end time'|translate}}" datetimepicker min-date="{{start_created}}" ng-model="end_created">
            <pickpoint-list ng-model="pickpoint_id" dft="0"></pickpoint-list>
            <button class="sui-btn btn-primary" type="submit" ng-click="getOrderList(1)">{{'search'|translate}}</button>
            </button>
            <button class="sui-btn btn-danger" type="submit" ng-click="syncorder()">{{'同步订单'|translate}}</button>
<!--            <button class="sui-btn btn-error" type="submit" ng-click="yorder()">{{'同步渝欧订单'|translate}}</button>-->
<!--            <button class="sui-btn btn-danger" type="submit" ng-click="pddorder()">{{'同步拼多多订单'|translate}}</button>-->
            </button>
            <!-- <export-data startcreated="start_created" endcreated="end_created" orderid="order_id" chosedstatus="chosedStatus">
            </export-data> -->
        </span>
    </ul>
    <div class="sui-row-fluid">
        <extr-order-statu-tab ng-model="chosedStatus" click-tab="tabClick()"></extr-order-statu-tab>
        <table class="sui-table table-bordered">
            <thead>
                <tr>
                    <th>{{'#'|translate}}</th>
                    <th>{{'订单商品'|translate}}</th>
                    <!-- <th>{{'来源'|translate}}</th> -->
                    <th>{{'Orderid'|translate}}</th>
                    <!-- <th>{{'total_fee'|translate}}</th> -->
                    <!-- <th>{{'包装费'|translate}}</th> -->
                    <!-- <th>{{'运费'|translate}}</th> -->
                    <th>{{'支付金额'|translate}}</th>
                    <th>{{'收货人'|translate}}</th>
                    <!-- <th>{{'创建时间'|translate}}</th> -->
                    <th>{{'operation'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="(key, list) in orderslist">
                    <td>
                        <input type="checkbox" name="fhmoder" checklist-model="$parent.fhmoder" checklist-value="list">
                    </td>
                    <td>
                        <span class="sui-label label-success">{{ list.order_from == 'YUOU'?'渝欧':'' }} {{ list.order_from == 'PDD'?'拼多多':'' }} {{ list.order_from == 'HZW'?'孩子王':'' }} {{ list.order_from == 'TB'?'淘宝':'' }} {{ list.order_from == 'HPK'?'海拍客':'' }}</span>

                        <table class="sui-table table-bordered">
                            <tr>
                                <td>{{'主图/编号'|translate}}</td>
                                <td>{{'title'|translate}}</td>
                                <td>{{'数量'|translate}}</td>
                                <th>{{ "组合装" | translate }}</th>
                            </tr>
                            <tr ng-repeat="item in list.items">
                                <td>
                                    <img ng-src="{{item.image}}" width="60"><br>
                                    <button class="btn" ngclipboard data-clipboard-text="{{item.sku_outer_id}}" ngclipboard-success="onSuccess(e,this);">
                                        {{item.sku_outer_id}}
                                    </button>
                                </td>
                                <td><span style="display: block;width: 100px;word-wrap:break-word">{{item.title}}</span></td>
                                <td>
                                    {{item.price}}
                                    <br /> 数量：{{item.quantity}}
                                </td>
                                <td>
                                    <sku-item-list outerid="{{item.sku_outer_id}}"></sku-item-list>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <!-- <td>
                        {{ list.order_from == 'YUOU'?'渝欧':'' }} {{ list.order_from == 'PDD'?'拼多多':'' }} {{ list.order_from == 'HZW'?'孩子王':'' }} {{ list.order_from == 'TB'?'淘宝':'' }}
                    </td> -->
                    <td style="width: 160px;">
                        <button class="btn" ngclipboard data-clipboard-text="{{list.order_id}}" ngclipboard-success="onSuccess(e,this);">
                            {{list.order_id}}
                        </button>
                        <br /> {{list.created_at | ddtt}}
                        <div class="sui-msg msg-tips">
                            <div class="msg-con">
                                <order-status ng-model="list.status" stype="1"></order-status>
                            </div>
                            <s class="msg-icon"></s>
                        </div>
                        <div ng-if="list.pickpoint_id">
                            <order-hg-status order-id="list.order_id"></order-hg-status>
                        </div>
                        <div ng-if="shipping_corp">
                            <div>{{list.shipping_corp}}</div>
                            <div>{{list.shipping_code}}</div>
                        </div>
                    </td>
                    <!-- <td style="width: 70px;">{{list.total_fee}}</td> -->
                    <!-- <td>{{list.packing_fee}}</td> -->
                    <!-- <td>
                        {{list.post_fee}}
                    </td> -->
                    <td style="width: 70px;">
                        {{list.payment}}
                        <br><br>
                        <span ng-show="list.coupon_fee">(包含优惠:{{list.coupon_fee}}元
                            <br>
                            <br>
                            包含税费:{{list.total_tax}}元)</span>
                    </td>
                    <td>
                        {{list.deliver_name}}
                        <br /> {{list.deliver_phone}}
                        <br />
                        <span style="display: block;width: 100px;word-wrap:break-word">{{list.province}} {{list.city}}
                            {{list.district}} {{list.deliver_address}}</span>
                        <hr /> {{list.id_name}}
                        <br /> {{list.id_code}}
                        <hr /> {{list.note}}

                        <br />
                        <id-card id-number="list.id_code" id-name="list.id_name" orderid="list.order_id"></id-card>
                    </td>
                    <!-- <td>{{list.created_at | ddtt}}</td> -->
                    <td style="width: 160px;">
                        <pickpoint-info ng-model="list.pickpoint_id"></pickpoint-info>
                        <br/>

                        <update-order-pickpoint ng-show="list.status == 'S_ORDER_WAIT_DELIVERY'" title="修改发货点" member-check="backpickpoint(pickpoint)" chosed-pid="list.pickpoint_id" order-id="list.order_id"></update-order-pickpoint>
                        <hr style="margin: 0 0;" />
                        <div ng-show="list.pickpoint_id && industryCode=='27'">
                            <span ng-show="list.order_from == 'TB'">
                                <payment-qrcode id="list.order_id" order-data="list"></payment-qrcode>
                                <button ng-click="postPay(list.order_id,list.order_from)" class="sui-btn btn-warning">推送支付单</button>
                            </span>
                            <br />
                            <button ng-click="operationOrder(list.order_id,3,list.order_from)" class="sui-btn btn-success">推送订单</button>
                            <!-- <button ng-click="postOrder(list.order_id,3,list.order_from)" class="sui-btn btn-success">推送订单</button> -->
                            <br />
                            <button ng-show="list.status =='S_ORDER_WAIT_RECEIVE'" ng-click="postWms(list.order_id)" class="sui-btn btn-success">补推仓库</button>
                            <br />
                            <button ng-show="list.order_from =='YUOU'" ng-click="lackpaybill(list.order_id)" class="sui-btn btn-success">补推支付单</button>
                        </div>
                        <a href="#/customsorder/info?order_id={{list.order_id}}" class="sui-btn btn-info">查看</a>
                        <hr style="margin: 0 0;" />
                        <!--                        <button ng-show="list.order_from =='YUOU'" ng-click="confirmYuou(list.order_id)"  class="sui-btn btn-success">订单确认</button>-->
                        <hr style="margin: 0 0;" />
                        <button ng-show="list.status == 'S_ORDER_WAIT_DELIVERY'" ng-click="zuofei(list.order_id)" class="sui-btn btn-danger">作废</button>
                        <!--                        <hr style="margin: 0 0;"/>-->
                        <!--                        <update-order-wuliu ng-show="list.order_from == 'YUOU'" title="选择物流信息" member-check="YuouWuliu()" order-id="list.order_id"></update-order-wuliu>-->
                    </td>
                </tr>
            </tbody>
        </table>
        <!-- 分页start -->
        <span ng-show="orderslist.length>1">
            <button ng-click="checkAll()" class="sui-btn btn-success">
                <span ng-show="idtype">全选</span><span ng-show="!idtype">反选</span>
        </button>
        <button ng-show="selectedOrderIds" class="sui-btn btn-info" ngclipboard data-clipboard-text="{{selectedOrderIds}}" ngclipboard-success="onSuccess(e,this);">
                <i class="sui-icon icon-tb-edit"></i> 复制订单编号
            </button>
        </span>
        <pager page-no="{{pageNo}}" page-size="pageSize" total="ordersTotal" get-data="getOrderList(pageNo)"></pager>
    </div>
    <!-- 分页end -->
</div>